/**
 */
package tpi.obj3.dsle.dSLE.impl;

import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

import tpi.obj3.dsle.dSLE.DSLEPackage;
import tpi.obj3.dsle.dSLE.Dia;
import tpi.obj3.dsle.dSLE.Planificacion;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Planificacion</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link tpi.obj3.dsle.dSLE.impl.PlanificacionImpl#getAnio <em>Anio</em>}</li>
 *   <li>{@link tpi.obj3.dsle.dSLE.impl.PlanificacionImpl#getSemestre <em>Semestre</em>}</li>
 *   <li>{@link tpi.obj3.dsle.dSLE.impl.PlanificacionImpl#getLunes <em>Lunes</em>}</li>
 *   <li>{@link tpi.obj3.dsle.dSLE.impl.PlanificacionImpl#getMartes <em>Martes</em>}</li>
 *   <li>{@link tpi.obj3.dsle.dSLE.impl.PlanificacionImpl#getMiercoles <em>Miercoles</em>}</li>
 *   <li>{@link tpi.obj3.dsle.dSLE.impl.PlanificacionImpl#getJueves <em>Jueves</em>}</li>
 *   <li>{@link tpi.obj3.dsle.dSLE.impl.PlanificacionImpl#getViernes <em>Viernes</em>}</li>
 *   <li>{@link tpi.obj3.dsle.dSLE.impl.PlanificacionImpl#getSabado <em>Sabado</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class PlanificacionImpl extends ElementoImpl implements Planificacion
{
  /**
   * The default value of the '{@link #getAnio() <em>Anio</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getAnio()
   * @generated
   * @ordered
   */
  protected static final int ANIO_EDEFAULT = 0;

  /**
   * The cached value of the '{@link #getAnio() <em>Anio</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getAnio()
   * @generated
   * @ordered
   */
  protected int anio = ANIO_EDEFAULT;

  /**
   * The default value of the '{@link #getSemestre() <em>Semestre</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getSemestre()
   * @generated
   * @ordered
   */
  protected static final int SEMESTRE_EDEFAULT = 0;

  /**
   * The cached value of the '{@link #getSemestre() <em>Semestre</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getSemestre()
   * @generated
   * @ordered
   */
  protected int semestre = SEMESTRE_EDEFAULT;

  /**
   * The cached value of the '{@link #getLunes() <em>Lunes</em>}' containment reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getLunes()
   * @generated
   * @ordered
   */
  protected Dia lunes;

  /**
   * The cached value of the '{@link #getMartes() <em>Martes</em>}' containment reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getMartes()
   * @generated
   * @ordered
   */
  protected Dia martes;

  /**
   * The cached value of the '{@link #getMiercoles() <em>Miercoles</em>}' containment reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getMiercoles()
   * @generated
   * @ordered
   */
  protected Dia miercoles;

  /**
   * The cached value of the '{@link #getJueves() <em>Jueves</em>}' containment reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getJueves()
   * @generated
   * @ordered
   */
  protected Dia jueves;

  /**
   * The cached value of the '{@link #getViernes() <em>Viernes</em>}' containment reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getViernes()
   * @generated
   * @ordered
   */
  protected Dia viernes;

  /**
   * The cached value of the '{@link #getSabado() <em>Sabado</em>}' containment reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getSabado()
   * @generated
   * @ordered
   */
  protected Dia sabado;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected PlanificacionImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return DSLEPackage.Literals.PLANIFICACION;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public int getAnio()
  {
    return anio;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setAnio(int newAnio)
  {
    int oldAnio = anio;
    anio = newAnio;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, DSLEPackage.PLANIFICACION__ANIO, oldAnio, anio));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public int getSemestre()
  {
    return semestre;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setSemestre(int newSemestre)
  {
    int oldSemestre = semestre;
    semestre = newSemestre;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, DSLEPackage.PLANIFICACION__SEMESTRE, oldSemestre, semestre));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Dia getLunes()
  {
    return lunes;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetLunes(Dia newLunes, NotificationChain msgs)
  {
    Dia oldLunes = lunes;
    lunes = newLunes;
    if (eNotificationRequired())
    {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DSLEPackage.PLANIFICACION__LUNES, oldLunes, newLunes);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
    return msgs;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setLunes(Dia newLunes)
  {
    if (newLunes != lunes)
    {
      NotificationChain msgs = null;
      if (lunes != null)
        msgs = ((InternalEObject)lunes).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DSLEPackage.PLANIFICACION__LUNES, null, msgs);
      if (newLunes != null)
        msgs = ((InternalEObject)newLunes).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DSLEPackage.PLANIFICACION__LUNES, null, msgs);
      msgs = basicSetLunes(newLunes, msgs);
      if (msgs != null) msgs.dispatch();
    }
    else if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, DSLEPackage.PLANIFICACION__LUNES, newLunes, newLunes));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Dia getMartes()
  {
    return martes;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetMartes(Dia newMartes, NotificationChain msgs)
  {
    Dia oldMartes = martes;
    martes = newMartes;
    if (eNotificationRequired())
    {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DSLEPackage.PLANIFICACION__MARTES, oldMartes, newMartes);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
    return msgs;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setMartes(Dia newMartes)
  {
    if (newMartes != martes)
    {
      NotificationChain msgs = null;
      if (martes != null)
        msgs = ((InternalEObject)martes).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DSLEPackage.PLANIFICACION__MARTES, null, msgs);
      if (newMartes != null)
        msgs = ((InternalEObject)newMartes).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DSLEPackage.PLANIFICACION__MARTES, null, msgs);
      msgs = basicSetMartes(newMartes, msgs);
      if (msgs != null) msgs.dispatch();
    }
    else if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, DSLEPackage.PLANIFICACION__MARTES, newMartes, newMartes));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Dia getMiercoles()
  {
    return miercoles;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetMiercoles(Dia newMiercoles, NotificationChain msgs)
  {
    Dia oldMiercoles = miercoles;
    miercoles = newMiercoles;
    if (eNotificationRequired())
    {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DSLEPackage.PLANIFICACION__MIERCOLES, oldMiercoles, newMiercoles);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
    return msgs;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setMiercoles(Dia newMiercoles)
  {
    if (newMiercoles != miercoles)
    {
      NotificationChain msgs = null;
      if (miercoles != null)
        msgs = ((InternalEObject)miercoles).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DSLEPackage.PLANIFICACION__MIERCOLES, null, msgs);
      if (newMiercoles != null)
        msgs = ((InternalEObject)newMiercoles).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DSLEPackage.PLANIFICACION__MIERCOLES, null, msgs);
      msgs = basicSetMiercoles(newMiercoles, msgs);
      if (msgs != null) msgs.dispatch();
    }
    else if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, DSLEPackage.PLANIFICACION__MIERCOLES, newMiercoles, newMiercoles));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Dia getJueves()
  {
    return jueves;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetJueves(Dia newJueves, NotificationChain msgs)
  {
    Dia oldJueves = jueves;
    jueves = newJueves;
    if (eNotificationRequired())
    {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DSLEPackage.PLANIFICACION__JUEVES, oldJueves, newJueves);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
    return msgs;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setJueves(Dia newJueves)
  {
    if (newJueves != jueves)
    {
      NotificationChain msgs = null;
      if (jueves != null)
        msgs = ((InternalEObject)jueves).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DSLEPackage.PLANIFICACION__JUEVES, null, msgs);
      if (newJueves != null)
        msgs = ((InternalEObject)newJueves).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DSLEPackage.PLANIFICACION__JUEVES, null, msgs);
      msgs = basicSetJueves(newJueves, msgs);
      if (msgs != null) msgs.dispatch();
    }
    else if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, DSLEPackage.PLANIFICACION__JUEVES, newJueves, newJueves));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Dia getViernes()
  {
    return viernes;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetViernes(Dia newViernes, NotificationChain msgs)
  {
    Dia oldViernes = viernes;
    viernes = newViernes;
    if (eNotificationRequired())
    {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DSLEPackage.PLANIFICACION__VIERNES, oldViernes, newViernes);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
    return msgs;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setViernes(Dia newViernes)
  {
    if (newViernes != viernes)
    {
      NotificationChain msgs = null;
      if (viernes != null)
        msgs = ((InternalEObject)viernes).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DSLEPackage.PLANIFICACION__VIERNES, null, msgs);
      if (newViernes != null)
        msgs = ((InternalEObject)newViernes).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DSLEPackage.PLANIFICACION__VIERNES, null, msgs);
      msgs = basicSetViernes(newViernes, msgs);
      if (msgs != null) msgs.dispatch();
    }
    else if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, DSLEPackage.PLANIFICACION__VIERNES, newViernes, newViernes));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Dia getSabado()
  {
    return sabado;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetSabado(Dia newSabado, NotificationChain msgs)
  {
    Dia oldSabado = sabado;
    sabado = newSabado;
    if (eNotificationRequired())
    {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DSLEPackage.PLANIFICACION__SABADO, oldSabado, newSabado);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
    return msgs;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setSabado(Dia newSabado)
  {
    if (newSabado != sabado)
    {
      NotificationChain msgs = null;
      if (sabado != null)
        msgs = ((InternalEObject)sabado).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DSLEPackage.PLANIFICACION__SABADO, null, msgs);
      if (newSabado != null)
        msgs = ((InternalEObject)newSabado).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DSLEPackage.PLANIFICACION__SABADO, null, msgs);
      msgs = basicSetSabado(newSabado, msgs);
      if (msgs != null) msgs.dispatch();
    }
    else if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, DSLEPackage.PLANIFICACION__SABADO, newSabado, newSabado));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
  {
    switch (featureID)
    {
      case DSLEPackage.PLANIFICACION__LUNES:
        return basicSetLunes(null, msgs);
      case DSLEPackage.PLANIFICACION__MARTES:
        return basicSetMartes(null, msgs);
      case DSLEPackage.PLANIFICACION__MIERCOLES:
        return basicSetMiercoles(null, msgs);
      case DSLEPackage.PLANIFICACION__JUEVES:
        return basicSetJueves(null, msgs);
      case DSLEPackage.PLANIFICACION__VIERNES:
        return basicSetViernes(null, msgs);
      case DSLEPackage.PLANIFICACION__SABADO:
        return basicSetSabado(null, msgs);
    }
    return super.eInverseRemove(otherEnd, featureID, msgs);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case DSLEPackage.PLANIFICACION__ANIO:
        return getAnio();
      case DSLEPackage.PLANIFICACION__SEMESTRE:
        return getSemestre();
      case DSLEPackage.PLANIFICACION__LUNES:
        return getLunes();
      case DSLEPackage.PLANIFICACION__MARTES:
        return getMartes();
      case DSLEPackage.PLANIFICACION__MIERCOLES:
        return getMiercoles();
      case DSLEPackage.PLANIFICACION__JUEVES:
        return getJueves();
      case DSLEPackage.PLANIFICACION__VIERNES:
        return getViernes();
      case DSLEPackage.PLANIFICACION__SABADO:
        return getSabado();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case DSLEPackage.PLANIFICACION__ANIO:
        setAnio((Integer)newValue);
        return;
      case DSLEPackage.PLANIFICACION__SEMESTRE:
        setSemestre((Integer)newValue);
        return;
      case DSLEPackage.PLANIFICACION__LUNES:
        setLunes((Dia)newValue);
        return;
      case DSLEPackage.PLANIFICACION__MARTES:
        setMartes((Dia)newValue);
        return;
      case DSLEPackage.PLANIFICACION__MIERCOLES:
        setMiercoles((Dia)newValue);
        return;
      case DSLEPackage.PLANIFICACION__JUEVES:
        setJueves((Dia)newValue);
        return;
      case DSLEPackage.PLANIFICACION__VIERNES:
        setViernes((Dia)newValue);
        return;
      case DSLEPackage.PLANIFICACION__SABADO:
        setSabado((Dia)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case DSLEPackage.PLANIFICACION__ANIO:
        setAnio(ANIO_EDEFAULT);
        return;
      case DSLEPackage.PLANIFICACION__SEMESTRE:
        setSemestre(SEMESTRE_EDEFAULT);
        return;
      case DSLEPackage.PLANIFICACION__LUNES:
        setLunes((Dia)null);
        return;
      case DSLEPackage.PLANIFICACION__MARTES:
        setMartes((Dia)null);
        return;
      case DSLEPackage.PLANIFICACION__MIERCOLES:
        setMiercoles((Dia)null);
        return;
      case DSLEPackage.PLANIFICACION__JUEVES:
        setJueves((Dia)null);
        return;
      case DSLEPackage.PLANIFICACION__VIERNES:
        setViernes((Dia)null);
        return;
      case DSLEPackage.PLANIFICACION__SABADO:
        setSabado((Dia)null);
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case DSLEPackage.PLANIFICACION__ANIO:
        return anio != ANIO_EDEFAULT;
      case DSLEPackage.PLANIFICACION__SEMESTRE:
        return semestre != SEMESTRE_EDEFAULT;
      case DSLEPackage.PLANIFICACION__LUNES:
        return lunes != null;
      case DSLEPackage.PLANIFICACION__MARTES:
        return martes != null;
      case DSLEPackage.PLANIFICACION__MIERCOLES:
        return miercoles != null;
      case DSLEPackage.PLANIFICACION__JUEVES:
        return jueves != null;
      case DSLEPackage.PLANIFICACION__VIERNES:
        return viernes != null;
      case DSLEPackage.PLANIFICACION__SABADO:
        return sabado != null;
    }
    return super.eIsSet(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public String toString()
  {
    if (eIsProxy()) return super.toString();

    StringBuffer result = new StringBuffer(super.toString());
    result.append(" (anio: ");
    result.append(anio);
    result.append(", semestre: ");
    result.append(semestre);
    result.append(')');
    return result.toString();
  }

} //PlanificacionImpl
